﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBHelper;
using BusinessLayer.FindArtInfo.Entities;
using System.Data.SqlClient;
using System.Data;
using BusinessLayer.FindArtInfo.Models;

namespace BusinessLayer.FindArtInfo
{
    public class ArtistLinkBL
    {
        public List<ArtistLinkDetailExtend> GetByArtistId(int artistId)
        {
            List<ArtistLinkDetailExtend> result = new List<ArtistLinkDetailExtend>();
            var adapter = new BaseDAO(DbConfig.DbFindArtInfoConnectionString);
            adapter.AddParameter("@ArtistId", artistId);            
            try
            {
                result = adapter.GetList<ArtistLinkDetailExtend>("sp_ArtistLink_Select_By_ArtistId", CommandType.StoredProcedure, CustomConnectionState.CloseOnExit);
            }
            catch (Exception)
            {
            }
            finally { adapter.Dispose(); }
            return result;
        }        
    }
}
